package com.zjb.demo.system.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Get;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.annotation.Param;
import org.noear.solon.core.handle.Context;

@Api(tags = "示例")
@Controller
public class DemoController {
    @Get
    @Mapping("/hello")
    @ApiOperation(value = "hello")
    public String hello(@Param(defaultValue = "world") String name) {
        return String.format("Hello %s!", name);
    }
    @Mapping("/")
    @ApiOperation(value = "主页跳转")
    public void index(Context ctx){
        ctx.forward("/index.html");
    }
}